package club.caihappy.server.service;

import club.caihappy.server.pojo.Admin;
import club.caihappy.server.pojo.Menu;
import club.caihappy.server.pojo.RespBean;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.security.core.Authentication;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author seven
 * @since 2022-05-07
 */
public interface IAdminService extends IService<Admin> {

    RespBean login(String adminLoginParamUsername, String username, String password, HttpServletRequest request);


    Admin getAdminByUsername(String username);


    /**
     * 获取所有操作员
     * @param keywords
     * @return
     */
    List<Admin> getAllAdmins(String keywords);

    /**
     * 更新操作员角色
     * @param adminId
     * @param rids
     * @return
     */
    RespBean updateAdminRole(Integer adminId, Integer[] rids);

    /**
     * 修改操作员密码
     * @param oldPwd
     * @param newPwd
     * @param adminId
     * @return
     */
    RespBean updatePwdById(String oldPwd, String newPwd, String adminId);

    RespBean updateAdminUserface(String filepath, Integer id, Authentication authentication);
}
